Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dhcp support #20

Open
wants to merge 23 commits into
base: master
Choose a base branch
from

Conversation

ohthehugemanatee
Copy link
Contributor

Closes #19

  1. sync now includes the whole dnsmasq.d directory except the file which enables dhcp. There are a thousand reasons to add custom dnsmasq config files, and none of them are hurt by syncing the whole directory.
  2. sync now includes dhcp leases.
  3. when keepalived checks pihole status, it also checks to see if this node owns the vip. If so, it enables/disables DHCP appropriately. (there are new settings in inventory.yaml for dhcp)
  4. DHCP settings are included in pihole container start
  5. if dhcp and HA are enabled, dnsmasq is configured to handout the virtual IP instead of the host IP during the pihole role.

Copy link
Owner

@shaderecker shaderecker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @ohthehugemanatee, many thanks for contributing this PR! I really appreciate it.
It looks good overall, can you check my two comments/questions 🙂

@@ -32,7 +32,7 @@

- name: Schedule sync with cron
ansible.builtin.cron:
hour: "2,14"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you revert those values to the originals please since the shorter sync interval is only needed for dhcp.
Maybe you can provide some example values, that you consider good, in the readme.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

At least in my experience the dns performance was impaired pretty easily, so I would like to keep the sync jobs to a minimum by default.

@@ -35,4 +43,29 @@ if [[ ! $(ip a | grep {{ sync_target }}) ]]; then
sudo cp --preserve=timestamps $sync_dir/05-pihole-custom-cname.conf $pihole_dir/dnsmasq.d
fi
fi

RSYNC_WILDCARD=$(rsync -a --info=name -e "ssh $key $host_key_check" $target:$pihole_dir/dnsmasq.d/02-cluster.vert-wildcard.conf $sync_dir)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the reason to sync this file separately when you later on sync the whole dnsmasq.d directory?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Does not work with pihole DHCP
2 participants